package jgcp.master.scheduler;

import java.util.Comparator;

import jgcp.common.Task;

/**
 * 
 * @Date 29/05/2009
 * @author Jie Zhao (288654) Dongwei Qi
 * @version 1.0
 */
public class EDF implements Comparator<Task> {
public int compare(Task o1, Task o2) {
	if(o1.getDeadline() == null && o2.getDeadline() != null)
	{
		return 1;
	}
	else if(o2.getDeadline() == null && o1.getDeadline() != null)
	{
		return -1;
	}
	return o1.getDeadline().compareTo(o2.getDeadline());
}
}
